package acwing;

import java.io.*;
import java.util.*;

public class ac92 {
    static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
    static final int N = 20;
    static int n;
    static boolean[] st = new boolean[N];

    static int cin() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }

    static void dfs(int u) {
        if (u > n) {
            for (int i = 1; i <= n; i ++ ) {
                if (st[i]) out.print(i + " ");
            }
            out.println();
            return ;
        }

        st[u] = true;
        dfs (u + 1);
        st[u] = false;
        dfs (u + 1);
    }

    public static void main(String[] args) throws IOException {
        n = cin();
        dfs (1);
        out.close();
    }
}